package com.lkd.controller;


import com.lkd.entity.Order;
import com.lkd.service.OrderService;
import com.lkd.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 聂德祥
 * @since 2024-08-20
 */
@RestController
public class OrderController {
@Autowired
    private OrderService orderService;
@GetMapping("/api/order-service/report/orderCount")
public Result getOrderByTime(@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime start,@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime end){
    Integer num=orderService.getOrderByTime(start,end);
    return Result.success(num);
}
@GetMapping("/api/order-service/report/orderAmount")
    public Result getOrderAmount(@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime start,@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime end){

    Integer num=orderService.getOrderAmount(start,end);

    return Result.success(num);
}
}
